unit EditErrProc;

interface

uses
  Winapi.Windows, Winapi.Messages, SysUtils, Variants, Classes, Graphics,
  Controls, Forms, Dialogs, uniGUITypes, uniGUIAbstractClasses,
  uniGUIClasses, uniGUIForm, DB, uniGUIBaseClasses, uniButton, uniBitBtn,
  uniMemo, uniDBMemo, uniLabel, jpeg, uniImage, uniEdit, uniMultiItem,
  uniComboBox, uniDBComboBox, uniDBEdit, DBClient, ClientRowSet;

type
  TFrmEditErrProc = class(TUniForm)
    btSave: TUniBitBtn;
    btClose: TUniBitBtn;
    dsProc: TDataSource;
    UniImage8: TUniImage;
    lbCaption: TUniLabel;
    edRemark: TUniDBMemo;
    UniLabel2: TUniLabel;
    cbProcType: TUniDBComboBox;
    UniLabel3: TUniLabel;
    UniLabel4: TUniLabel;
    UniLabel5: TUniLabel;
    cbNodeName: TUniDBComboBox;
    UniLabel1: TUniLabel;
    UniLabel6: TUniLabel;
    UniLabel7: TUniLabel;
    edContactor: TUniDBEdit;
    edTel: TUniDBEdit;
    eduser: TUniDBEdit;
    edProcTime: TUniDBEdit;
    crsErrProc: TClientRowSet;
    crsErrProcPROC_ID: TStringField;
    crsErrProcBILL_ID: TStringField;
    crsErrProcBILL_NO: TStringField;
    crsErrProcPROC_CODE: TIntegerField;
    crsErrProcPROC_CAP: TStringField;
    crsErrProcCAPTION: TStringField;
    crsErrProcCONTENT: TStringField;
    crsErrProcUSER_NO: TStringField;
    crsErrProcUSER_NAME: TStringField;
    crsErrProcCOMPANY: TStringField;
    crsErrProcCONTACTOR: TStringField;
    crsErrProcPHONENO: TStringField;
    crsErrProcPROC_TM: TStringField;
    crsErrProcGROUP_CODE: TStringField;
    crsErrProcNODE_NO: TStringField;
    crsErrProcNODE_NAME: TStringField;
    crsErrProcCALL_ID: TStringField;
    crsErrProcUPDATETIME: TStringField;
    crsErrProcSYS_ACCOUNT: TStringField;
    crsErrProcVERSION: TIntegerField;
    procedure btSaveClick(Sender: TObject);
    procedure btCloseClick(Sender: TObject);
    procedure UniFormShow(Sender: TObject);
    procedure UniFormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    BillDataset:TClientRowset;
    procedure RefreshCompList;
  end;

function FrmEditErrProc: TFrmEditErrProc;

implementation

{$R *.dfm}

uses
  MainModule, uniGUIApplication,srvModule, uCommFunction;

function FrmEditErrProc: TFrmEditErrProc;
begin
  Result := TFrmEditErrProc(UniMainModule.GetFormInstance(TFrmEditErrProc));
end;

procedure TFrmEditErrProc.btCloseClick(Sender: TObject);
begin
  TClientRowset(dsProc.DataSet).CancelUpdates;
  self.Close;
end;

procedure TFrmEditErrProc.btSaveClick(Sender: TObject);
begin
  TClientRowset(dsProc.DataSet).ApplyUpdates;
  self.Close;
end;

procedure TFrmEditErrProc.RefreshCompList;
  procedure AddComp(fieldname:String);
  var
    scomp:String;
  begin
    scomp := BillDataset.FieldByName(fieldname).AsString;
    if (cbNodeName.Items.IndexOf(scomp) < 0) and (scomp <>'') then
    begin
      cbNodeName.Items.Add(scomp);
    end;
  end;
begin
  cbNodeName.Clear;
  AddComp('src_node_name');
  AddComp('dst_node_name');
  AddComp('IN_UNI_COMPNAME');
  AddComp('OUT_UNI_COMPNAME');
  AddComp('SRC_COMP');
  AddComp('DST_COMP');

end;

procedure TFrmEditErrProc.UniFormCreate(Sender: TObject);
begin
  SetCompoentLanguage(Self);
end;

procedure TFrmEditErrProc.UniFormShow(Sender: TObject);
begin
  RefreshCompList;
end;

end.
